<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePatientsTable extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('patients', function(Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('病人姓名');
            $table->integer('sex')->default(0)->comment('性别');
            $table->integer('age')->nullable()->comment('年龄');
            $table->string('phone')->nullable()->comment('电话');
            $table->string('qq')->nullable()->comment('qq');
            $table->string('wechat')->nullable()->comment('微信');
            $table->text('content')->nullable()->comment('内容');
            $table->integer('patient_type_id')->nullable()->comment('病人类型');
            $table->integer('deportment_id')->nullable()->comment('所属科室');
            $table->integer('media_id')->nullable()->comment('媒体来源');
            $table->integer('zone_id')->nullable()->comment('地区来源');
            $table->string('expert_number')->nullable()->comment('专家号');
            $table->timestamp('push_date')->nullable()->comment('预约时间');
            $table->string('intro')->nullable()->comment('备注');
            $table->string('back_intro')->nullable()->comment('回访记录');
            $table->integer('come_state')->nullable()->comment('是否到诊');
            $table->timestamp('come_date')->nullable()->comment('到诊时间');
            $table->integer('doctor_id')->nullable()->comment('接待医生');
            $table->integer('user_id')->nullable()->comment('用户编号');
            $table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('patients');
	}

}
